package ar.edu.unlp.info.tesis.controladores.lrs;

import java.util.List;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;

import ar.edu.unlp.info.tesis.controladores.GenericController;
import ar.edu.unlp.info.tesis.database.service.GenericService;
import ar.edu.unlp.info.tesis.database.service.VerbService;
import ar.edu.unlp.info.tesis.domain.Verb;


@Controller
@RequestMapping(value = "/verb/")
public class VerbController extends GenericRestController{
	
	@RequestMapping(value = "get/{idVerb}", method = RequestMethod.GET, headers = "Accept=application/json")
	@ResponseBody
	public Verb get(@PathVariable("idVerb")  long idVerb){
		return (Verb)new VerbService().getById(idVerb);
	}
	
	@RequestMapping(value = "getAll", method = RequestMethod.GET, headers = "Accept=application/json")
	@ResponseBody
	public List<Verb> getAll()
	{
		return new VerbService().getList();
	}
}
